package com.hjsoft.autofu.utils;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * @ClassName:ImgTool
 * @Author:QM-LiuHongqing
 * @Create: 2023-01-17 10:42
 */
public class ImgTool {
    //提取图片工具1
    public static BufferedImage getimg(String path) {
        BufferedImage img = null;
        try {
            img = ImageIO.read(new File(path));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return img;
    }

    //工具2
    public static Image getImage(String filename) {
        return Toolkit.getDefaultToolkit().getImage(filename);
    }
}
